import { http } from "@/utils/request";
import { type ResUserInfo, type ResOriginalImage } from "./types/commonType";

// 根据图片uuid获取原图
export const queryOriginalImages = (imgIds: string[]) => {
  return http.post<ResOriginalImage[]>("/image/getOriginalImageUri", imgIds);
};

//上传 base64 编码的图片，返回缩略图uri和原图uri，其中原图uri会过期
// FIXME: 接口可以传数组，为了确保数据对应，还是一张一张传，后续和后端对接
export const userUploadImages = (data: Base64URLString[]) => {
  return http.post<ResOriginalImage[]>("/image/userUploadImages", data);
};

/*  user相关 */
// 获取个人信息
export const getUserInfo = () => {
  return http.get<ResUserInfo>("/getInfo");
};
